#pragma once
#include "atltypes.h"
#include "GridHelper.h"

// CDiagramWnd

class CDiagramWnd : public CWnd, public CGridHelper
{
	DECLARE_DYNAMIC(CDiagramWnd)

public:
	CDiagramWnd();
	virtual ~CDiagramWnd();

protected:
	DECLARE_MESSAGE_MAP()

public:
	virtual void SetGridSize(long row, long column);
	virtual void Draw(CDC *dc, CRect rect) = 0;
	BOOL Create(const RECT& rect, CWnd* pParentWnd, UINT nControlID = NULL);

protected:
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnPaint();
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);

	void SetupScrollbars(void);

private:
	virtual void DrawBackground( CDC* dc, CRect rect);
	virtual void SetHScroll( int pos );
	virtual void SetVScroll( int pos );
};


